<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>39 | 一级计划开始准备</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 

</script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- Graph CSS -->
<link href="css/lines.css" rel='stylesheet' type='text/css' />
<link href="css/font-awesome.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Sortable -->
<link href="css/jquery-ui.min.css" />
<script src="js/jquery-ui.min.js"></script>
<script src="js/sortable-cetc39.js"></script>
<!-- Nav CSS -->
<link href="css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="js/d3.v3.js"></script>
<script src="js/rickshaw.js"></script>
<style>
.nodeList ul {
	list-style: none;
}

.nodeList li {
	float: left;
}
</style>
<script type="text/javascript">
	window.onload = function() {

		// 允许拖动
		draggable();

		var nowDate = new Date();
		var setStart = document.getElementById("setStart");
		setStart.value = nowDate.getFullYear() + "-" + nowDate.getMonth() + "-"
				+ nowDate.getDate() + " " + nowDate.getHours() + ":"
				+ nowDate.getMinutes();
		setStartSpan.innerHTML = nowDate.getFullYear() + "年"
				+ nowDate.getMonth() + "月" + nowDate.getDate() + "日 "
				+ nowDate.getHours() + ":" + nowDate.getMinutes();
	};

	function getNodeDetail(id, opcode) {
		var newWindow = null;
		if (newWindow == null || newWindow.closed) {
			openUrl = "nodeDetail?opcode=" + opcode + "&node_id=" + id;
			var width = 900;
			var height = 630;
			var left = parseInt((screen.availWidth / 2) - (width / 2));
			var top = parseInt((screen.availHeight / 2) - (height / 2));
			var windowFeatures = "width="
					+ width
					+ ",height="
					+ height
					+ ",status=no,resizable=0,scrollbars=0,titlebar=0,toolbar=0,location=no,menubar=0,left="
					+ left + ",top=" + top + "screenX=" + left + ",screenY="
					+ top;
			newWindow = window.open(openUrl, "node_update_subWind",
					windowFeatures);
		} else {
			newWindow.focus();
		}
	}

	function menuQuery() {
		var firstplan_id = $("#firstplan_id").val();
		var openUrl = "node_null01.html?id=" + firstplan_id;//弹出窗口的url
		var newWindow = null;
		if (newWindow == null || newWindow.closed) {
			var width = 800;
			var height = 690;
			var left = parseInt((screen.availWidth / 2) - (width / 2));
			var top = parseInt((screen.availHeight / 2) - (height / 2));
			var windowFeatures = "width="
					+ width
					+ ",height="
					+ height
					+ ",status=no,resizable=0,scrollbars=0,titlebar=0,toolbar=0,location=no,menubar=0,left="
					+ left + ",top=" + top + "screenX=" + left + ",screenY="
					+ top;
			newWindow = window
					.open(openUrl, "add_node_subWind", windowFeatures);
		} else {
			newWindow.focus();
		}
	}
</script>
</head>
<body>
	<div id="wrapper">
		<!-- Navigation -->
		<!-- left.jsp -->
		<jsp:include page="left.jsp"></jsp:include>
		<div id="page-wrapper">

			<div class="graphs">
				<div class="xs">
					<h3>一级计划开始准备</h3>
					<div class="tab-content">
						<div class="tab-pane active" id="horizontal-form">
							<input type="hidden" value="${firstplan.project.project_name }"
								id="firstplan_project_name" /> <input type="hidden"
								value="${firstplan.id }" id="firstplan_id" />
							<table class="table">
								<tr>
									<td><b>项目令号</b>
									</td>
									<td style="color:red">${firstplan.project.project_code
										}&nbsp;&nbsp;${firstplan.project.project_name }</td>
									<td><b>计划开始创建时间</b>
									</td>
									<td style="color:red"><fmt:formatDate
											value="${firstplan.plan_setstart }"
											pattern="yyyy-MM-dd HH:mm:ss" /></td>
									<td><b>计划版本</b>
									</td>
									<td style="color:red">${firstplan.plan_version }</td>
								</tr>
							</table>
							<hr />

							<h3>节点列表</h3>
							<table class="table" id="node_table">
								<thead>
									<tr>
										<td>节点编号</td>
										<td>节点要求开始时间</td>
										<td>节点要求完成时间</td>
										<td>节点描述</td>
										<td align="center">操作</td>
									</tr>
								</thead>
								<tbody id="sortable">
									<c:forEach items="${nodeList }" var="node">
										<tr>
											<td>${node.node_id }</td>
											<td>${fn:substring(node.node_starttime, 0, 10) }</td>
											<td>${fn:substring(node.node_endtime, 0, 10) }</td>
											<td>${node.node_describe }</td>
											<td align="center">
												<button
													onclick="getNodeDetail(this.value, 'getNodeDetailForShow')"
													value="${node.id }">查看详情</button>|
												<button
													onclick="getNodeDetail(this.value, 'getNodeDetailForUpdatePreCreate')"
													value="${node.id }">修改</button>|
												<button
													onclick="window.location.href='deleteNode?node_id=${node.id }'">删除</button>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<hr />
							<div class="form-group" align="center">
								<c:if test="${firstplan.project.summary != null }">
									<button class="btn btn-primary" onclick="menuQuery()">添加节点</button>
								</c:if>
								<c:choose>
									<c:when test="${sessionScope.user.role.id == 2}">
										<button class="btn btn-primary"
											onclick="location.href='release_plan?plan_id=${firstplan.id}'">发布计划</button>
									</c:when>
									<c:when test="${sessionScope.user.role.id == 3}">
										<button class="btn btn-primary"
											onclick="location.href='access_plan?plan_id=${firstplan.id}'">审批</button>
									</c:when>
								</c:choose>
							</div>
						</div>
					</div>
				</div>
				<div class="copy_layout">
					<jsp:include page="copyright.jsp"></jsp:include>
				</div>
			</div>

		</div>
		<!-- /#page-wrapper -->
	</div>
	<!-- /#wrapper -->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.min.js"></script>
</body>
</html>
